<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('留言人列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>留言人ID：</label>
                                <input type="text" name="memberId"/>
                            </li>
                            <li>
                                <label>留言人名称：</label>
                                <input type="text" name="memberName"/>
                            </li>
                            <li>
                                <label>留言人类型：0-个人 1-企业：</label>
                                <select name="memberType">
                                    <option value="">所有</option>
                                    <option value="-1">代码生成请选择字典属性</option>
                                </select>
                            </li>
                            <li>
                                <label>被留言人ID：</label>
                                <input type="text" name="messageMemberId"/>
                            </li>
                            <li>
                                <label>被留言人名称：</label>
                                <input type="text" name="messageMemberName"/>
                            </li>
                            <li>
                                <label>被留言人类型：0-个人 1-企业：</label>
                                <select name="messageMemberType">
                                    <option value="">所有</option>
                                    <option value="-1">代码生成请选择字典属性</option>
                                </select>
                            </li>
                            <li>
                                <label>相关ID：</label>
                                <input type="text" name="resId"/>
                            </li>
                            <li>
                                <label>留言类型：0-供应 1-求购 2-其他：</label>
                                <select name="type">
                                    <option value="">所有</option>
                                    <option value="-1">代码生成请选择字典属性</option>
                                </select>
                            </li>
                            <li>
                                <label>最新内容：</label>
                                <input type="text" name="newMessage"/>
                            </li>
                            <li class="select-time">
                                <label>创建时间：</label>
                                <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginCreatedTime]"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endCreatedTime]"/>
                            </li>
                            <li class="select-time">
                                <label>修改时间：</label>
                                <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginUpdatedTime]"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endUpdatedTime]"/>
                            </li>
                            <li>
                                <label>是否已读：0-未读 1-已读：</label>
                                <input type="text" name="isRead"/>
                            </li>
                            <li>
                                <label>未读消息数：</label>
                                <input type="text" name="unreadNum"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:messageuser:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:messageuser:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:messageuser:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:messageuser:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('system:messageuser:edit')}]];
        var removeFlag = [[${@permission.hasPermi('system:messageuser:remove')}]];
        var prefix = ctx + "system/messageuser";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "留言人",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id', 
                    title: 'null',
                    visible: false
                },
                {
                    field: 'memberId', 
                    title: '留言人ID'
                },
                {
                    field: 'memberName', 
                    title: '留言人名称'
                },
                {
                    field: 'memberType', 
                    title: '留言人类型：0-个人 1-企业'
                },
                {
                    field: 'messageMemberId', 
                    title: '被留言人ID'
                },
                {
                    field: 'messageMemberName', 
                    title: '被留言人名称'
                },
                {
                    field: 'messageMemberType', 
                    title: '被留言人类型：0-个人 1-企业'
                },
                {
                    field: 'resId', 
                    title: '相关ID'
                },
                {
                    field: 'type', 
                    title: '留言类型：0-供应 1-求购 2-其他'
                },
                {
                    field: 'newMessage', 
                    title: '最新内容'
                },
                {
                    field: 'createdTime', 
                    title: '创建时间'
                },
                {
                    field: 'updatedTime', 
                    title: '修改时间'
                },
                {
                    field: 'isRead', 
                    title: '是否已读：0-未读 1-已读'
                },
                {
                    field: 'unreadNum', 
                    title: '未读消息数'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>